﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyGeneric20180617
{
    class GenericMethod
    {
       /// <summary>
       /// 1. 延迟声明：把参数类型的声明推迟到调用
       /// 2. 不是语法糖，而是由框架升级提供的功能
       /// </summary>
       /// <typeparam name="T"></typeparam>
       /// <param name="tParameter"></param>
        public static void Show<T>(T tParameter)
        {
            Console.WriteLine("This is {0}, parameter={1}, type={2}", typeof(GenericMethod).Name, tParameter.GetType().Name, tParameter);
        }



        /// <summary>
        /// object
        /// 1.任何父类出现的地方，都可以用子类来替换
        /// 2. object是一切类型的父类
        /// </summary>
        /// <param name="iParameter"></param>
        public static void ShowObject(Object iParameter)
        {
            Console.WriteLine("This is {0}, parameter={1}, type={2}", typeof(GenericMethod).Name, iParameter.GetType().Name, iParameter);
        }
    }
}
